package com.example.discover.viewmodel

import androidx.lifecycle.ViewModel
import com.example.featuresdk.model.Topic
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class BookViewportViewModel @Inject constructor() :ViewModel(){

    val groupedTopics : MutableMap<String, MutableList<Topic>> = mutableMapOf()

    init{
        Topic.topics.map { topic ->
            val capital = topic.key[0].uppercase()
            if(groupedTopics.containsKey(capital)){
                groupedTopics[capital]!!.add(topic)
            }else{
                groupedTopics[capital] = mutableListOf(topic)
            }
        }
    }
}